import { get_relation_describe_rev } from './get_mdb';
import { remove_relation_single } from './remove_relation_single';

export async function remove_relation(
  target_main: string,
  describe: string,
  target_num: string | string[]
) {
  if (typeof target_num == 'string') {
    target_num = [target_num];
  }

  // 正常 流
  await remove_relation_single(target_main, describe, target_num);

  let describe_rev = await get_relation_describe_rev(describe);

  // 反转 流
  for (const target_i_val of target_num) {
    await remove_relation_single(target_i_val, describe_rev, target_main);
  }
}
